package com.warm.calc.demo.service.parser;

import com.warm.calc.demo.entity.CalcCompleteData;
import com.warm.calc.demo.entity.CalcKeyword;
import com.warm.calc.demo.entity.CalcSourceData;
import com.warm.calc.demo.entity.CalcType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class AttributeHandler {

    @Autowired
    private List<AbstractAttributeParser> parsers;

    public boolean parser(CalcSourceData source, CalcCompleteData target, List<CalcKeyword> keywords, List<CalcType> types){
        parsers.forEach(parser -> parser.parserAttribute(source, target, keywords, types));
        return true;
    }
}
